﻿// ===============================================================================
// XCI.NET 西安交通信息WinForm开发框架 2018 版权所有
// ===============================================================================

using DevExpress.Images;
using DevExpress.Utils.Svg;
using System.Drawing;

namespace XCI.Core
{
    /// <summary>
    /// 公共资源/常量
    /// </summary>
    public class R
    {
        public static SvgImage TreeOpenFolderSvgImage { get; set; }
        public static SvgImage TreeCloseFolderSvgImage { get; set; }
        public static SvgImage DeptTreeSvgImage { get; set; }
        public static SvgImage DicCategoryTreeSvgImage { get; set; }
        public static SvgImage DicTreeSvgImage { get; set; }

        static R()
        {
            GridSettingImage16 = ImageResourceCache.Default.GetImage("office2013/setup/properties_16x16.png");
            DefaultModuleImage32 = ImageResourceCache.Default.GetImage("images/ui/window_32x32.png");
            DefaultModuleImage16 = ImageResourceCache.Default.GetImage("images/ui/window_16x16.png");
            DefaultPermissionImage32 = ImageResourceCache.Default.GetImage("office2013/setup/properties_32x32.png");
            DefaultPermissionImage16 = ImageResourceCache.Default.GetImage("office2013/setup/properties_16x16.png");
            MainFormHomePageHome16 = ImageResourceCache.Default.GetImage("images/navigation/home_16x16.png");
            MainFormHomePageHome32 = ImageResourceCache.Default.GetImage("images/navigation/home_32x32.png");

            FirstPage16 = ImageResourceCache.Default.GetImage("images/arrows/first_16x16.png");
            LastPage16 = ImageResourceCache.Default.GetImage("images/arrows/last_16x16.png");
            NextPage16  = ImageResourceCache.Default.GetImage("images/arrows/next_16x16.png");
            PreviousPage16 = ImageResourceCache.Default.GetImage("images/arrows/prev_16x16.png");
            RefreshPage16 = ImageResourceCache.Default.GetImage("images/scheduling/recurrence_16x16.png");


            DeptTreeSvgImage = ImageResourceCache.Default.GetSvgImage("svgimages/business%20objects/bo_category.svg");
            DicCategoryTreeSvgImage = ImageResourceCache.Default.GetSvgImage("svgimages/icon%20builder/actions_book.svg");
            DicTreeSvgImage = ImageResourceCache.Default.GetSvgImage("svgimages/icon%20builder/actions_bookmark.svg");

            TreeOpenFolderSvgImage = ImageResourceCache.Default.GetSvgImage("svgimages/actions/open.svg");
            TreeCloseFolderSvgImage = ImageResourceCache.Default.GetSvgImage("svgimages/icon%20builder/actions_folderclose.svg");

            #region StatusImgBoolColumn

            //var statusImages = new DevExpress.Utils.SvgImageCollection();
            //statusImages.Insert(0,  global::XCI.Properties.Resources.ActionDisable);
            //statusImages.Insert(1, global::XCI.Properties.Resources.ActionEnable);

            //StatusImgBoolColumn = new RepositoryItemImageComboBox();
            //StatusImgBoolColumn.AutoHeight = false;
            //StatusImgBoolColumn.GlyphAlignment = HorzAlignment.Center;
            //StatusImgBoolColumn.Items.AddRange(new [] {
            //    new ImageComboBoxItem("禁用", false, 0),
            //    new ImageComboBoxItem("启用", true, 1)});
            //StatusImgBoolColumn.Name = "statusImgBoolColumn";
            //StatusImgBoolColumn.SmallImages = statusImages;

            //StatusImgIntColumn = new RepositoryItemImageComboBox();
            //StatusImgIntColumn.AutoHeight = false;
            //StatusImgIntColumn.GlyphAlignment = HorzAlignment.Center;
            //StatusImgIntColumn.Items.AddRange(new[] {
            //    new ImageComboBoxItem("禁用", 0, 0),
            //    new ImageComboBoxItem("启用", 1, 1)});
            //StatusImgIntColumn.Name = "statusImgIntColumn";
            //StatusImgIntColumn.SmallImages = statusImages;

            //StatusImgStringColumn = new RepositoryItemImageComboBox();
            //StatusImgStringColumn.AutoHeight = false;
            //StatusImgStringColumn.GlyphAlignment = HorzAlignment.Center;
            //StatusImgStringColumn.Items.AddRange(new[] {
            //    new ImageComboBoxItem("禁用", "0", 0),
            //    new ImageComboBoxItem("启用", "1", 1)});
            //StatusImgStringColumn.Name = "statusImgStringColumn";
            //StatusImgStringColumn.SmallImages = statusImages;

            #endregion
        }

        ///// <summary>
        ///// 布尔状态列
        ///// </summary>
        //public static DevExpress.XtraEditors.Repository.RepositoryItemImageComboBox StatusImgBoolColumn { get; set; }

        ///// <summary>
        ///// 整数状态列
        ///// </summary>
        //public static DevExpress.XtraEditors.Repository.RepositoryItemImageComboBox StatusImgIntColumn { get; set; }

        ///// <summary>
        ///// 字符串状态列
        ///// </summary>
        //public static DevExpress.XtraEditors.Repository.RepositoryItemImageComboBox StatusImgStringColumn { get; set; }

        /// <summary>
        /// 表格配置图标(16*16)
        /// </summary>
        public static Image GridSettingImage16 { get; set; }

        /// <summary>
        /// 默认模块图标(16*16)
        /// </summary>
        public static Image DefaultModuleImage16 { get; set; }

        /// <summary>
        /// 默认模块图标(32*32)
        /// </summary>
        public static Image DefaultModuleImage32 { get; set; }

        /// <summary>
        /// 默认权限图标(16*16)
        /// </summary>
        public static Image DefaultPermissionImage16 { get; set; }

        /// <summary>
        /// 默认权限图标(32*32)
        /// </summary>
        public static Image DefaultPermissionImage32 { get; set; }

        /// <summary>
        /// 第一页图标(16*16)
        /// </summary>
        public static Image FirstPage16 { get; set; }

        /// <summary>
        /// 前一页图标(16*16)
        /// </summary>
        public static Image PreviousPage16 { get; set; }

        /// <summary>
        /// 下一页图标(16*16)
        /// </summary>
        public static Image NextPage16 { get; set; }

        /// <summary>
        /// 最后页图标(16*16)
        /// </summary>
        public static Image LastPage16 { get; set; }

        /// <summary>
        /// 刷新页图标(16*16)
        /// </summary>
        public static Image RefreshPage16 { get; set; }

        /// <summary>
        /// 主界面主页图标(16*16)
        /// </summary>
        public static Image MainFormHomePageHome16 { get; set; }

        /// <summary>
        /// 主界面主页图标(32*32)
        /// </summary>
        public static Image MainFormHomePageHome32 { get; set; }

        /// <summary>
        /// 默认键名称
        /// </summary>
        public const string DefaultName = "Default";

        /// <summary>
        /// 应用程序配置名称
        /// </summary>
        public const string AppSettingsName = "AppSettings";

        /// <summary>
        /// 主界面主页编码
        /// </summary>
        public const string MainFormHomePageCode = "@winform-home@";

        /// <summary>
        /// JwtToken缓存键
        /// </summary>
        public const string JwtTokenCacheKey = "Cache-JwtToken";

        /// <summary>
        /// 用户权限列表缓存键
        /// </summary>
        public const string CurrentUserOwnModulesCacheKey = "Cache-CurrentUserOwnModules";

        /// <summary>
        /// 用户权限字典缓存键
        /// </summary>
        public const string CurrentUserOwnModulesMapCacheKey = "Cache-UserModuleMap";

        /// <summary>
        /// 用户数据字典键值对缓存键
        /// </summary>
        public const string DicMapCacheKey = "Cache-DicMap";

        public const string Empty = "";
        public const string RootTreeId = "0";
        public const string RootTreeText = "无";

        /// <summary>
        /// 默认日期时间格式字符串
        /// </summary>
        public const string DEFAULT_DATETIME_PATTERN = "yyyy-MM-dd HH:mm:ss";

        /// <summary>
        /// 日期分钟格式字符串
        /// </summary>
        public const string DEFAULT_DATE_MS_PATTERN = "yyyy-MM-dd HH:mm";

        /// <summary>
        /// 默认日期格式字符串
        /// </summary>
        public const string DEFAULT_DATE_PATTERN = "yyyy-MM-dd";

        /// <summary>
        /// 默认时间格式字符串
        /// </summary>
        public const string DEFAULT_TIME_PATTERN = "HH:mm:ss";

        /// <summary>
        /// Id字段
        /// </summary>
        public const string FIdName = "id";

        /// <summary>
        /// Ids字段
        /// </summary>
        public const string FIdsName = "ids";

        /// <summary>
        /// ParentId字段
        /// </summary>
        public const string FParentIdName = "parentId";

        /// <summary>
        /// Code字段
        /// </summary>
        public const string FCodeName = "code";

        /// <summary>
        /// 关键字字段
        /// </summary>
        public const string FKeyName = "key";

        /// <summary>
        /// 状态字段
        /// </summary>
        public const string FStatusName = "status";

        /// <summary>
        /// existById接口名称
        /// </summary>
        public const string ApiExistByIdName = "existById";

        /// <summary>
        /// existByCode接口名称
        /// </summary>
        public const string ApiExistByCodeName = "existByCode";

        /// <summary>
        /// existByName接口名称
        /// </summary>
        public const string ApiExistByNameName = "existByName";

        /// <summary>
        /// insert接口名称
        /// </summary>
        public const string ApiInsertName = "insert";

        /// <summary>
        /// update接口名称
        /// </summary>
        public const string ApiUpdateName = "update";

        /// <summary>
        /// delete接口名称
        /// </summary>
        public const string ApiDeleteName = "delete";

        /// <summary>
        /// updateStatus接口名称
        /// </summary>
        public const string ApiUpdateStatusName = "updateStatus";

        /// <summary>
        /// UpdateDnd 接口名称
        /// </summary>
        public const string ApiUpdateDndName = "updateDnd";

        /// <summary>
        /// batchUpdateValues接口名称
        /// </summary>
        public const string ApiBatchUpdateValuesName = "batchUpdate";

        /// <summary>
        /// selectById接口名称
        /// </summary>
        public const string ApiSelectByIdName = "selectById";

        /// <summary>
        /// selectByCode接口名称
        /// </summary>
        public const string ApiSelectByCodeName = "selectByCode";

        /// <summary>
        /// refreshCache接口名称
        /// </summary>
        public const string ApiRefreshCacheName = "refresh";

        /// <summary>
        /// export接口名称
        /// </summary>
        public const string ApiExportName = "export";

        /// <summary>
        /// selectPageList接口名称
        /// </summary>
        public const string ApiSelectPageListName = "selectPageList";

        /// <summary>
        /// selectList接口名称
        /// </summary>
        public const string ApiSelectListName = "selectList";

        /// <summary>
        /// 服务器文件本地存储子目录
        /// </summary>
        public const string FileLocalSubCatalog = "data";

        public const string ControlEditValueName = "EditValue";

        public const int EnterKey = 13;
        public const int EscKey = 27;
        public const int DeleteKey = 127;


    }
   
}